<?php
/**
 * Created by b17
 * 3/1/12 7:08 PM
 */

namespace Managers;

class Transaction extends BaseManager
{
    const TABLE = '\Catalog\Transactions';

    protected $__table = self::TABLE;

    public function create(\Catalog\Users $user, $moneyCount, $transaction)
    {
        $entity = new \Catalog\Transactions();
        $entity->setCreatedAt(new \DateTime());
        $entity->setMoneyCount($moneyCount);
        $entity->setTransaction($transaction);
        $entity->setUser($user);

        $this->_em->persist($entity);
        $this->flush();
        return $entity;
    }
}
